package com.kede.app.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.kede.app.converenum.CeriConverEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
* @description /
* @author Pr.li
* @date 2023-06-06
**/
@Entity
@Data
@Table(name="sy_zhi_user_certified")
public class ZhiUserCertified implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 用户id
    */
    @ApiModelProperty(value = "用户id")
    @Column(name = "`user_id`")
    private Integer userId;
    /**
    * 0=未支付,1=已支付
    */
    @ApiModelProperty(value = "0=未支付,1=已支付")
    @Column(name = "`is_pay`")
    private Integer isPay;
    /**
    * 门店名称
    */
    @ApiModelProperty(value = "门店名称")
    @Column(name = "`store_name`")
    private String storeName;
    /**
    * 姓名
    */
    @ApiModelProperty(value = "姓名")
    @Column(name = "`user_name`")
    private String userName;
    /**
    * 门店头像
    */
    @ApiModelProperty(value = "门店头像")
    @Column(name = "`avatarimage`")
    private String avatarimage;
    /**
    * 联系电话
    */
    @ApiModelProperty(value = "联系电话")
    @Column(name = "`mobile`")
    private String mobile;
    /**
    * 居住地址
    */
    @ApiModelProperty(value = "居住地址")
    @Column(name = "`address`")
    private String address;
    /**
    * 详细地址
    */
    @ApiModelProperty(value = "详细地址")
    @Column(name = "`address_detaail`")
    private String addressDetaail;
    /**
    * 身份证号
    */
    @ApiModelProperty(value = "身份证号")
    @Column(name = "`card_no`")
    private String cardNo;
    /**
    * 身份证人像
    */
    @ApiModelProperty(value = "身份证人像")
    @Column(name = "`headimage`")
    private String headimage;
    /**
    * 身份证国徽
    */
    @ApiModelProperty(value = "身份证国徽")
    @Column(name = "`bgimage`")
    private String bgimage;
    /**
    * 营业执照
    */
    @ApiModelProperty(value = "营业执照")
    @Column(name = "`zhizhaoimage`")
    private String zhizhaoimage;
    /**
    * 1营业中0休息中
    */
    @ApiModelProperty(value = "1营业中0休息中")
    @Column(name = "`store_status`")
    private Integer storeStatus;
    /**
    * 经度
    */
    @ApiModelProperty(value = "经度")
    @Column(name = "`lng`")
    private String lng;
    /**
    * 维度
    */
    @ApiModelProperty(value = "维度")
    @Column(name = "`lat`")
    private String lat;
    /**
    * 1门店2区代理3市代理
    */
    @ApiModelProperty(value = "1门店2区代理3市代理")
    @Column(name = "`type`")
    private Integer type;
    /**
    * 状态0审核中1审核通过2审核拒绝
    */
    @ApiModelProperty(value = "状态0审核中1审核通过2审核拒绝")
    @Column(name = "`status`")
    @Convert(converter = CeriConverEnum.Converter.class)
    private CeriConverEnum status;
    /**
    * 拒绝原因
    */
    @ApiModelProperty(value = "拒绝原因")
    @Column(name = "`reason`")
    private String reason;
    /**
    * 营业状态1营业中0歇业
    */
    @ApiModelProperty(value = "营业状态1营业中0歇业")
    @Column(name = "`is_work`")
    private Integer isWork;
    /**
    * 订单编号
    */
    @ApiModelProperty(value = "订单编号")
    @Column(name = "`order_sn`")
    private String orderSn;
    /**
    * 认证金额
    */
    @ApiModelProperty(value = "认证金额")
    @Column(name = "`money`")
    private BigDecimal money;
    /**
    * 营业开始时间
    */
    @ApiModelProperty(value = "营业开始时间")
    @Column(name = "`starttime`")
    private String starttime;
    /**
    * 营业结束时间
    */
    @ApiModelProperty(value = "营业结束时间")
    @Column(name = "`endtime`")
    private String endtime;
    /**
    * 时间
    */
    @ApiModelProperty(value = "时间")
    @Column(name = "`createtime`")
    private Integer createtime;
    /**
    * 时间
    */
    @ApiModelProperty(value = "时间")
    @Column(name = "`updatetime`")
    private Integer updatetime;
    /**
    * 
    */
    @ApiModelProperty(value = "sheng")
    @Column(name = "`sheng`")
    private String sheng;
    /**
    * 
    */
    @ApiModelProperty(value = "shi")
    @Column(name = "`shi`")
    private String shi;
    /**
    * 
    */
    @ApiModelProperty(value = "qu")
    @Column(name = "`qu`")
    private String qu;
    /**
    * 区级地区编码
    */
    @ApiModelProperty(value = "区级地区编码")
    @Column(name = "`area_code`")
    private Integer areaCode;

    @ApiModelProperty(value = "服务距离 单位m")
    @Column(name = "service_distance")
    private Integer serviceDistance;

    @ApiModelProperty(value = "是否开启现金置换")
    @Column(name = "enable_zhi_money")
    private Integer enableZhiMoney;

    @ApiModelProperty(value = "是否开启自己上传功能")
    @Column(name = "enable_own_upload")
    private Integer enableOwnUpload;

    @ApiModelProperty(value = "是否开启用户无限上传功能")
    @Column(name = "enable_user_upload")
    private Integer enableUserUpload;

    @Transient
    private List<SuppliesStore> suppliesStoreList;

    public void copy(ZhiUserCertified source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
